
(in-package #:smugmug)

(defclass session ()
  ((session-id :initarg :session-id
               :accessor session-id)
   (user-id :initarg :user-id
            :accessor user-id)
   (account-type :initarg :account-type
                 :accessor account-type)
   (password-hash :initarg :password-hash
                  :accessor password-hash)))

(defclass album ()
  ((album-id :initarg :album-id
             :accessor album-id)
   (title :initarg :title
          :accessor title)
   (category :initarg :category
             :type category
             :accessor category)
   (sub-category :initarg sub-category
                 :type category
                 :accessor sub-category)
   (session :initarg :session
            :type session
            :accessor session)))

(defclass category ()
  ((category-id :initarg :category-id
                :accessor category-id)
   (title :initarg :title
          :accessor title)
   (session :initarg :session
            :accessor session)))

(defclass stats ()
  ((bytes :initarg :bytes
          :type integer
          :reader bytes)
   (tiny :initarg :tiny
         :type integer
         :reader tiny)
   (thumb :initarg :thumb
          :type integer
          :reader thumb)
   (small :initarg :small
          :type integer
          :reader small)
   (medium :initarg :medium
           :type integer
           :reader medium)
   (large :initarg :large
          :type integer
          :reader large)
   (original :initarg :original
             :type single-float
             :reader original)))

(defclass image ()
  ((image-id :initarg :image-id
             :reader image-id)
   (session :initarg :session
            :reader session)))

(define-condition rest-error ()
  ((code :initarg :code
         :type integer
         :reader code)
   (message :initarg :message
            :reader message))
  (:report (lambda (condition stream)
             (format stream "REST response code ~S: ~S"
                     (code condition)
                     (message condition)))))

(define-condition http-error ()
  ((code :initarg :code
         :type integer
         :accessor code)
   (message :initarg :message
            :accessor message)))
